Path: blob/master/src/packages/next/pages/software/[index].tsx
1450 views
/*1* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import {6LANGUAGE_NAMES,7SOFTWARE_ENV_DEFAULT,8} from "@cocalc/util/consts/software-envs";910const INDEX_PAGES = LANGUAGE_NAMES.map((l) => l.toLowerCase()).concat(11"executables"12) as readonly string[];1314export default function SoftwareIndex() {15return <></>;16}1718export async function getServerSideProps(context) {19const { index } = context.params;20if (!INDEX_PAGES.includes(index)) {21return { notFound: true };22} else {23// permanent redirect, since this page is deprecated and the default software env version should be used24return context.res.redirect(25308,26`/software/${index}/${SOFTWARE_ENV_DEFAULT}`27);28}29}303132